Skip to content

dgb(coin): SSOT for V36 PPLNS exponential weight-decay rate - #450

Merged
frstrtr merged 1 commit into
masterfrom
dgb/share-weight-decay-ssot
Jun 25, 2026
Merged

dgb(coin): SSOT for V36 PPLNS exponential weight-decay rate#450
frstrtr merged 1 commit into
masterfrom
dgb/share-weight-decay-ssot

Conversation

@frstrtr

@frstrtr frstrtr commented Jun 24, 2026

Copy link
Copy Markdown
Owner

Phase-B SSOT pillar — V36 PPLNS exponential weight-decay rate

Lifts the decay-rate arithmetic shared by three open-coded copies in
src/impl/dgb/share_tracker.hpp into a new SSOT header
src/impl/dgb/coin/share_weight_decay.hpp:

  • init_decay_table() (decay-table precompute, ~line 170)
  • get_v36_decayed_cumulative_weights() (hot-path PPLNS weights, ~line 1718)
  • the [PARENT-PPLNS] GENTX-mismatch diagnostic dump (~line 1793)

All three compute the same constants:

half_life   = max(chain_length / 4, 1)
decay_per   = SCALE - (SCALE * 693147) / (1e6 * half_life)
decayed_att = (att * decay_fp) >> 40            (40-bit fixed point)

Oracle / 3-bucket classification

Conforms to frstrtr/p2pool-merged-v36 p2pool/data.py
get_decayed_cumulative_weights (the V36-native decayed PPLNS path).
This is bucket-2 (v36-native shared structure) — standardize cross-coin
toward this shape for the V37 unified migration. It is distinct from the older
p2pool-dgb-scrypt flat WeightsSkipList baseline (no decay), which stays the
live path during the crossing window and is not touched here.

Fenced

  • Header-only constexpr; share_tracker.hpp is NOT rewired. The
    byte-identity delegation of the three copies is the follow-on PR.
  • The per-depth decay_fp accumulation is an 80-bit product done with
    mul128_shift in the caller's walk — that stays in share_tracker.hpp; the
    SSOT exposes only the rate constants and the final attempts shift.
  • Per-coin isolation holds: only src/impl/dgb/** + the build.yml allowlist.
    No shared/bitcoin_family or other-coin tree.

Proof

  • dgb_share_weight_decay_test 6/6 green. Non-circular: half_life /
    decay_per / decayed_attempts goldens are hand-derived from the oracle formula
    (CL=8640 V36, CL=2880 baseline, tiny-chain half_life=1 guard), not from the
    helper under test.
  • Registered in both the test CMakeLists.txt and the build.yml
    --target allowlist (default + AUX_DOGE arms) — avoids the ci: build test_dgb_subsidy in both Linux test jobs (fix master-red NOT_BUILT) #143 NOT_BUILT
    trap.
  • GPG-signed, attribution-clean.

No self-merge — integrator taps after full-rollup green.

@frstrtr
frstrtr force-pushed the dgb/share-weight-decay-ssot branch 2 times, most recently from 06204bf to 0a8af02 Compare June 25, 2026 00:29
Lift the decay-rate arithmetic shared by three open-coded copies in
share_tracker.hpp (init_decay_table, get_v36_decayed_cumulative_weights,
and the [PARENT-PPLNS] diagnostic dump) into coin/share_weight_decay.hpp:
  half_life   = max(chain_length / 4, 1)
  decay_per   = SCALE - (SCALE * 693147) / (1e6 * half_life)
  decayed_att = (att * decay_fp) >> 40        (40-bit fixed point)

Conforms to frstrtr/p2pool-merged-v36 data.py get_decayed_cumulative_weights
(the V36-native decayed PPLNS path; 3-bucket rule bucket-2 v36-native shared
structure, distinct from the older p2pool-dgb-scrypt flat WeightsSkipList
baseline that stays live during the crossing window).

FENCED: header-only constexpr, share_tracker.hpp NOT rewired -- the
byte-identity delegation of the three copies is the follow-on PR. The
per-depth decay_fp accumulation (80-bit mul128_shift) stays in the caller's
walk; the SSOT exposes only the rate constants and the final attempts shift.

Non-circular KAT dgb_share_weight_decay_test (6/6): half_life, decay_per, and
decayed_attempts goldens are hand-derived from the oracle formula (CL=8640
V36 / 2880 baseline / tiny-chain guard), not from the helper under test.
Registered in both the test CMakeLists and the build.yml --target allowlist
(#143 NOT_BUILT trap).
@frstrtr
frstrtr force-pushed the dgb/share-weight-decay-ssot branch from 0a8af02 to 4481afe Compare June 25, 2026 05:36
@frstrtr
frstrtr merged commit 62d3096 into master Jun 25, 2026
33 checks passed
frstrtr added a commit that referenced this pull request Jun 26, 2026
…rewire

dgb: rewire decay constants onto share_weight_decay SSOT (#450 follow-on)
frstrtr added a commit that referenced this pull request Jun 26, 2026
…p-ssot

dgb: route consensus get_desired_version_weights clamp onto chain_walk_window SSOT (#450 follow-on)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant